﻿using System;
using System.Collections.Generic;
using System.Net;
using System.Runtime.Serialization;
using System.Windows;
using System.Windows.Controls;
using System.Windows.Documents;
using System.Windows.Ink;
using System.Windows.Input;
using System.Windows.Media;
using System.Windows.Media.Animation;
using System.Windows.Shapes;

namespace ZFCNew.Code
{
    [DataContract]
    public class FacebookSearchData
    {
        [DataMember(Name = "data", Order = 1)]
        public List<FbSearchResult> Data { get; set; }

        [DataMember(Name = "paging", Order = 2)]
        public FbPaging Paging { get; set; }
        
        public FacebookSearchData()
        {
            Data = new List<FbSearchResult>();
        }
    }

    [DataContract]
    public class FbPaging
    {
        [DataMember(Name = "previous", Order = 1)]
        public string Previous { get; set; }

        [DataMember(Name = "next", Order = 1)]
        public string Next { get; set; }
    }

    [DataContract]
    public class FbSearchResult
    {
        [DataMember(Name = "id", Order = 1)]
        public string ID { get; set; }

        [DataMember(Name = "message", Order = 2)]
        public string Text { get; set; }

        [DataMember(Name = "link", Order = 3)]
        public string Link { get; set; }
        
        [DataMember(Name = "from", Order = 4)]
        public FBFrom From { get; set; }

        public string ProfileImageUrl
        {
            get
            {
                return From != null ? string.Format("http://graph.facebook.com/{0}/picture?type=large", From.ID) : null;
            }
        }
    }

    [DataContract]
    public class FBFrom
    {
        [DataMember(Name = "name", Order = 1)]
        public string Name { get; set; }

        [DataMember(Name = "id", Order = 2)]
        public string ID { get; set; }

        public string category { get; set; }

        
    }
}
